page_planDetail = (state={},action)->
  switch action.type
    when 'PLANDETAIL/GET_LIST_START'
      Object.assign {},state,{isLoading:true,refreshing:false}
    when 'PLANDETAIL/GET_LIST_COMPLETED'
      state.modelList[action.payload.model.CHDYNPLANID] = action.payload
      Object.assign {},state,{
        modelList:state.modelList
        isLoading:false
        refreshing:false
      }
    when 'PLANDETAIL/REFRESH_LIST_START'
      Object.assign {},state,{
        isLoading:false
        refreshing:true
      }
    when 'PLANDETAIL/REFRESH_LIST_COMPLETED'
      state.modelList[action.payload.model.CHDYNPLANID] = action.payload
      Object.assign {},state,{
        list:state.modelList
        isLoading:false
        refreshing:false
      }
    else
      state

module.exports = page_planDetail
